#ifndef MOLAS_H
#define MOLAS_H
#include <list>


#include "forcasResult.h"
#define SEMAFORO

template<class T> class ELEMENT_LIST ;
class SPRING ;
using namespace std;

class Molas : public ForcaResultante
{
    public:
            Molas(){}
            Molas(MODEL*md);
            SPRING* Forca(SPRING*k);
            void calcular();
            void ForcaResSS (SPHERE* s, SPHERE* t){}
            void ForcaResSL (SPHERE* s, LINE* l){}
    protected:
            ELEMENT_LIST<SPRING>*molas;

    private:
};

class MolasParalelo : public Molas
{
    public:
        MolasParalelo(MODEL*md);
        ~MolasParalelo()
        {
            for (SPHERE* s = pModel->SPHList.Begin; s != NULL;s = s->Next) omp_destroy_lock(&(s->semaforo));
            delete pModel;
            delete molas;
        }
        SPRING* Forca(SPRING*k);
        void calcular();
    protected:
    private:
            list<SPRING*> remSequenc;
            //bool listaDesbalanceada;
            void finalizaOperacoes();
            int qtdMolas;
};

#endif // MOLAS_H
